package com.flying.admin.service;

import java.util.Date;

import com.flying.common.annotation.DaoCreate;
import com.flying.common.annotation.DaoQuery;
import com.flying.common.annotation.DaoRemove;
import com.flying.common.annotation.DaoUpdate;
import com.flying.framework.annotation.MethodInfo;
import com.flying.framework.annotation.Param;
import com.flying.framework.annotation.Service;
import com.flying.framework.data.Data;
import com.flying.framework.service.AbstractService;

@Service(value="ModuleDeployLog", desc="模块部署记录")
public class ModuleDeployLog extends AbstractService{
	public final static String TABLE_NAME = "sys_module_deploy_log";
	
	public enum Field {
		
		log_id         ("log_id",            "int",	"流水ID"),
		module_id      ("module_id",         "String",	"模块ID"),
		app_id         ("app_id",            "String",	"应用ID"),
		op_type        ("op_type",           "int",	"操作类型(1:加载;0:卸载)"),
		op_time        ("op_time",           "Date",	"操作时间");
		
		public final String fieldName;
		public final String fieldType;
		public final String fieldComment;
	
		Field(String name, String dataType, String comment) {
			this.fieldName 		= name;
			this.fieldType		= dataType;
			this.fieldComment	= comment;
		}
	}
        
	@MethodInfo("创建模块部署记录")
	@DaoCreate(entity="sys_module_deploy_log")
	public Data create(
		
			@Param(value="module_id",         required=false,	desc="模块ID") String module_id,
			@Param(value="app_id",            required=false,	desc="应用ID") String app_id,
			@Param(value="op_type",           required=false,	desc="操作类型(1:加载;0:卸载)") int op_type,
			@Param(value="op_time",           required=false,	desc="操作时间") Date op_time
		
		) throws Exception {
		
		return new Data("op_type", 1, "op_time", new Date());
	}

	@MethodInfo("修改模块部署记录")
	@DaoUpdate(entity="sys_module_deploy_log")
	public Data update(
		
			@Param(value="log_id",            required=false,	desc="流水ID") int log_id,
			@Param(value="module_id",         required=false,	desc="模块ID") String module_id,
			@Param(value="app_id",            required=false,	desc="应用ID") String app_id,
			@Param(value="op_type",           required=false,	desc="操作类型(1:加载;0:卸载)") int op_type,
			@Param(value="op_time",           required=false,	desc="操作时间") Date op_time,
			@Param(value="fields", required=false, desc="更新字段", tag="fields") String[] fields
			
		) throws Exception {
		
		return null;
	}

	@MethodInfo("删除模块部署记录")
	@DaoRemove(entity="sys_module_deploy_log")
	public Data remove(
		
			@Param(value="log_id",            required=true,	desc="流水ID") int log_id
		
		) throws Exception {
		
		return null;
	}

	@MethodInfo("查询所有模块部署记录")
	@DaoQuery(entity="sys_module_deploy_log")
	public Data findAll() throws Exception {
		return null;
	}

	@MethodInfo("根据主键查询模块部署记录")
	@DaoQuery(entity="sys_module_deploy_log", single=true)
	public Data findById(
		
			@Param(value="log_id",            required=true,	desc="流水ID") int log_id
		
		) throws Exception {
		return null;
	}

}